//
//  HCAddressCell.m
//  HappyChildren
//
//  Created by jiayibai-02por on 2017/6/10.
//  Copyright © 2017年 WillyZhao. All rights reserved.
//

#import "HCAddressCell.h"

@interface HCAddressCell()

@property (nonatomic, strong) UIImageView *buttonImageView;

@end

@implementation HCAddressCell

- (void)awakeFromNib {
    [super awakeFromNib];

    self.nameLabel.textColor = [UIColor darkGrayColor];
    self.phoneLabel.textColor = [UIColor grayColor];
    self.addressLabel.textColor = [UIColor grayColor];
    
    self.buttonImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 20, 20)];
    self.buttonImageView.center = CGPointMake(self.chooseButton.frame.size.width/2.0, self.chooseButton.frame.size.height/2.0);
    [self.chooseButton addSubview:self.buttonImageView];
    [self.chooseButton addTarget:self action:@selector(chooseButtonClick:) forControlEvents:UIControlEventTouchUpInside];
}

- (void)chooseButtonClick:(UIButton *)sender {

    if (self.didClickChooseButtonBlock) {
        
        self.didClickChooseButtonBlock(self);
    }
}

- (void)setIsClicked:(BOOL)isClicked {

    _isClicked = isClicked;
    if (isClicked) {
        
        self.buttonImageView.image = [UIImage imageNamed:@"address_selected"];
    }
    else {
    
        self.buttonImageView.image = [UIImage imageNamed:@"address"];
    }
}


@end
